﻿namespace BusinessObjects.ValidationRules
{
    public class ValidateMandatory : ValidationRule
    {
        public ValidateMandatory(string propertyName) : base(propertyName)
        {
            ErrorMessage = string.Concat(propertyName, " is a mandatory field.");
        }

        public override bool Validate(object businessObject)
        {
            return GetPropertyValue(businessObject).ToString().Length > 0;
        }
    }
}
